package com.sunxueqi.framework.security.handler;

import java.io.IOException;
import java.io.Serializable;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.stereotype.Component;

import com.sunxueqi.common.utils.ServletUtils;

import cn.hutool.core.util.StrUtil;

@Component
public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable{

	public void commence(HttpServletRequest request, HttpServletResponse response,
			AuthenticationException authException) throws IOException, ServletException {
		String msg = "认证失败";
		ServletUtils.renderString(response, msg);
	}

}
